<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Web API Documentation</title>
    <link rel="stylesheet" href="css/color.css?v=2025-10-25 10:11:54">
    <link rel="stylesheet" href="css/dom.css?v=2025-10-25 10:11:54">
    <link rel="stylesheet" href="css/layout.css?v=2025-10-25 10:11:54">
    <link rel="stylesheet" href="css/flex.css?v=2025-10-25 10:11:54">
    <link rel="stylesheet" href="css/style.css?v=2025-10-25 10:11:54">
    <!-- <script src="swagger.js"></script> -->
    <script src="vue2.js?v=2025-10-25 10:11:54"></script>
    <script src="marked.js?v=2025-10-25 10:11:54"></script>
    <script>
        Vue.directive('markdown', {
            inserted(el, binding) {
                // binding.value 就是你传进来的 markdown 字符串
                el.innerHTML = marked.parse(binding.value || '');
            },
            update(el, binding) {
                // 当绑定值变化时重新渲染
                el.innerHTML = marked.parse(binding.value || '');
            }
        });
    </script>
</head>

<body class="loading">
    <div id="app" class="flex top hr full" style="display: none;">
        <div class="header flex column center hr" @mouseover="show_swagger_list=true"
            @mouseout="show_swagger_list=false">
            <h1 :title="unescape(swagger && swagger.info.description )">{{ title }} <sup> {{ version }} </sup> <sub
                    v-if="swagger && swaggers.length > 1">‥</sub></h1>
            <div class="flex center hr top" v-show="show_swagger_list && swaggers.length > 1">
                <div class="dropdown-content">
                    <a v-for="sw in swaggers" @click="switchSwagger(sw)">
                        {{sw.info.title}}<sup> {{ sw.info.version }} </sup>
                    </a>
                </div>
            </div>
        </div>
        <div class="nav flex hr">
            <a href="#">Home</a>
            <a href="#">API Overview</a>
            <a href="#">Authentication</a>
            <a href="#">Examples</a>
            <a href="#">Support</a>
        </div>
        <div class="container flex row full hr">
            <div class="sidebar flex column vr">
                <input v-model="search" type="search" placeholder="Filter..." class="filter-box" @keyup.esc="search=''">
                <div class="menu flex column full hr scroll" v-if="api_groups">
                    <ul class="flex hr" v-for="group in api_groups">
                        <li class="flex" v-show="highlight(group) || group.apis.some(highlight)"
                            :class="active_group===group && 'active'">
                            <span @click="active_group=(active_group===group?null:group)">
                                <span class="menu-title" v-html="highlight(group) || group.text"></span>
                            </span>
                            <ul class="submenu flex full right" v-show="active_group===group">
                                <li @click="active_api=api" v-for="api in group.apis"
                                    v-show="highlight(api) || !group.apis.some(highlight)"
                                    :class="active_api === api && 'active'">
                                    <span class="flex row center hr left nowrap">
                                        <i>{{api.method}}</i>
                                        <span class="flex row full wrap nowidth"
                                            v-html="highlight(api) || api.text"></span>
                                    </span>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="content flex column hr full" v-if="active_api">
                <div class="api-section flex full column scroll">
                    <h2>{{active_api.title || active_api.text}}</h2>

                    <div v-if="active_api.description" v-markdown="active_api.description"
                        @click="show_api_description=!show_api_description" style="cursor: pointer;"
                        :class="show_api_description ? '':'fade-text'">
                    </div>

                    <div class="api-endpoint">
                        <h3>接口路由 <button @click="openDialog('text', getHttpRequestMessage())">报文</button></h3>
                        <pre><i style="font-size:1.1em">{{active_api.method}}</i><span v-html="highlight(swagger.servers[0].url+active_api.path.toLowerCase()) || (swagger.servers[0].url+active_api.path.toLowerCase())"></span></pre>
                    </div>
                    <div class="api-endpoint">
                        <h3>接口说明</h3>
                        <p v-if="active_api.externalDocs">
                            <a :href="active_api.externalDocs.url"
                                target="_blank">{{active_api.externalDocs.description}}</a>
                        </p>
                        <p>{{active_api.summary}}</p>
                    </div>

                    <div class="api-endpoint"
                        v-for="(title, scope) in { header:'请求头',cookie:'cookie',path:'路由参数', query:'查询参数',formData:'表单参数' }"
                        v-show="active_api.parameters[scope].length">
                        <h3>
                            {{title}}
                        </h3>
                        <table>
                            <tr>
                                <th style="width: 240px;">参数名</th>
                                <th style="width: 240px;">类型</th>
                                <th style="width: 80px;">默认值</th>
                                <th style="width: 200px;">限制</th>
                                <th>说明</th>
                            </tr>
                            <tr v-for="parameter in active_api.parameters[scope]">
                                <td>{{parameter.name}}</td>
                                <td>{{getTypeText(parameter)}}</td>
                                <td>{{parameter.schema && parameter.schema.default}}</td>
                                <td v-markdown="getVaildText(parameter)"></td>
                                <td>{{parameter.description}} <a v-if="parameter['x-doc-url']"
                                        :href="parameter['x-doc-url']" target="_blank">参考文档</a> </td>
                            </tr>
                        </table>
                    </div>

                    <div id="request_body" class="api-endpoint" v-if="active_api.requestBody">
                        <h3>请求体</h3>
                        <div>
                            <div class="tabs flex row">
                                <button class="tablink" :class="active_request_body===content&&'active'"
                                    @click="active_request_body=content" @dblclick="openDialog(contentType, content)"
                                    v-for="(content, contentType) in active_api.requestBody.content">
                                    {{contentType}}
                                </button>
                            </div>
                            <div class="tabcontent" v-if="active_request_body">
                                <table>
                                    <!-- <caption v-if="contentType.includes('json')">
                                        <button class="showjson">Show Json</button>
                                    </caption> -->
                                    <tr>
                                        <th style="width: 240px;">参数名</th>
                                        <th style="width: 240px;">类型</th>
                                        <th style="width: 80px;">默认值</th>
                                        <th style="width: 200px;">限制</th>
                                        <th>说明</th>
                                    </tr>
                                    <template v-for="(schema, index) in parseSchema(active_request_body.schema)">
                                        <tr v-if="index>0" :id="schema.name">
                                            <th colspan="5">
                                                <h4>{{schema.description}}({{schema.name}}) <a href
                                                        onclick='document.getElementById("request_body").scrollIntoView({ behavior: "smooth" })'>↑</a>
                                                </h4>
                                            </th>
                                        </tr>
                                        <tr v-for="(property,name) in (schema.properties || [schema])">
                                            <td>{{ schema.properties? name:'-'}}</td>
                                            <td v-if="property.items && property.items.$ref">
                                                <a href="" @click="toSchemaView(property.items)">{{
                                                    getTypeText(property) }}</a>
                                            </td>
                                            <td v-else-if="property.$ref"><a href="" @click="toSchemaView(property)">{{
                                                    getTypeText(property) }}</a></td>
                                            <td v-else-if="property.type">{{ getTypeText(property) }}</td>
                                            <td v-else-if="property.enum">{{ property.enum.join(',') }}</td>
                                            <td v-else-if="property.allOf">{{ property.allOf.map(getTypeText).join('/') }}</td>
                                            <td v-else-if="property.oneOf">{{ property.oneOf.map(getTypeText).join('/') }}</td>
                                            <td v-else-if="property.anyOf">{{ property.anyOf.map(getTypeText).join('/') }}</td>
                                            <td v-else-if="property.not">{{ getTypeText(property) }}</td>
                                            <td v-else-if="property.items">{{ getTypeText(property) }}</td>
                                            <td v-else-if="property.additionalProperties">{{ getTypeText(property) }}</td>
                                            <td v-else>-</td>
                                            <td>{{property.default}}</td>
                                            <td v-markdown="getVaildText(schema, name)"></td>
                                            <td v-markdown="property.description"></td>
                                        </tr>
                                    </template>
                                </table>
                            </div>
                        </div>
                    </div>

                    <div class="api-endpoint">
                        <h3 id="response_body">响应体</h3>
                        <div class="tabs flex row">
                            <button class="tablink" :class="active_response===response&&'active'"
                                @click="active_response=response" @dblclick="openDialog('json', active_response_body)"
                                v-for="(response, code) in active_api.responses">
                                {{code}}<sup>{{response.description}}</sup>
                            </button>
                        </div>
                        <div class="tabcontent">
                            <div class="tabs flex row" v-if="active_response.content">
                                <label v-for="(content, contentType) in active_response.content">
                                    <input name="response_content_type" type="radio"
                                        @click="active_response_body=content"
                                        :checked="active_response_body===content" />{{contentType}}
                                </label>
                            </div>
                            <div v-else style="color: var(--color-text-light)">
                                无返回值
                            </div>
                            <table v-if="active_response_body">
                                <tr>
                                    <th style="width: 240px;">参数名</th>
                                    <th style="width: 240px;">类型</th>
                                    <th style="width: 80px;">默认值</th>
                                    <th>说明</th>
                                </tr>
                                <template v-for="(schema, index) in parseSchema(active_response_body.schema)">
                                    <tr v-if="index>0" :id="schema.name">
                                        <th colspan="4">
                                            <h4>{{schema.description}}({{schema.name}}) <a href
                                                    onclick='document.getElementById("response_body").scrollIntoView({ behavior: "smooth" })'>↑</a>
                                            </h4>
                                        </th>
                                    </tr>
                                    <tr v-for="(property,name) in (schema.properties || [schema])">
                                        <td>{{ schema.properties?name:'-'}}</td>
                                        <td v-if="property.items && property.items.$ref">
                                            <a href="" @click="toSchemaView(property.items)">{{ getTypeText(property)
                                                }}</a>
                                        </td>
                                        <td v-else-if="property.$ref"><a href="" @click="toSchemaView(property)">{{
                                                getTypeText(property) }}</a></td>
                                        <td v-else-if="property.type">{{ getTypeText(property) }}</td>
                                        <td v-else> any </td>
                                        <td>{{property.default}}</td>
                                        <td>{{property.description || getSchema(property).description}} <i
                                                v-if="property.$ref && getSchema(property).enum">(枚举：跳转到定义处查)</i></td>
                                    </tr>
                                </template>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="script.js?v=2025-10-25 10:11:54"></script>

    <base id="urlBase" target="_blank">
</body>

</html>